import request from '@/utils/request';

export function situation(params: any) {
    return request({
        method: "get",
        url: "/system/dict/data/type/channel_status",
        params
    })
}

// 列表信息
export function list(params: any) {
    return request({
        method: "get",
        url: "/tienchin/channel/list",
        params
    })
}

// 新增
export function add(data: any) {
    return request({
        method: "post",
        url: "/tienchin/channel",
        data
    })
}

// 修改
export function update(data: any) {
    return request({
        method: "put",
        url: "/tienchin/channel",
        data
    })
}

// 批量删除
export function usrdel(channelIds: number) {
    return request({
        method: "delete",
        url: `/tienchin/channel/${channelIds}`,
    })
}

// 根据渠道ID查询一个具体的渠道
export function detail(channelId: number) {
    return request({
        method: "get",
        url: `/tienchin/channel/${channelId}`,
    });
}

// 导出
export function exporton(data: any) {
    return request({
        method: "post",
        url: "/tienchin/channel/export",
        data,
        responseType: "blob"
    })
}

// 导入
export function exportins(data: any) {
    return request({
        method: "post",
        url: "/tienchin/channel/importData",
        data,
        responseType: "blob",
        headers: {
            'Content-Type': 'multipart/form-data'
        }
    })
}